package cn.shuangliang.contract.service;

import cn.shuangliang.contract.dao.AdminMapper;
import cn.shuangliang.contract.model.Admin;
import cn.shuangliang.contract.util.MyBatisUtil;

/**
 * @author oldliu
 * @since 1.0
 */
public class AdminService {
    public Admin login(String u, String p){
        try {
            AdminMapper mapper = MyBatisUtil.get().getMapper(AdminMapper.class);
            return mapper.login(u,p);
        } finally {
            MyBatisUtil.close();
        }
    }

    public int resetPass(Long id, String newPass, String oldPass) {
        try {
            AdminMapper mapper = MyBatisUtil.get().getMapper(AdminMapper.class);
            return mapper.resetPass(id,newPass,oldPass);
        } finally {
            MyBatisUtil.close();
        }
    }
}
